from math import sqrt

limit = 1000

results = dict()

for a in xrange(1, limit):
    for b in xrange(1, a + 1):
        c = sqrt(a*a + b*b)
        if c == int(c):
            sum = a + b + c
            if sum > limit: continue
            if results.has_key(sum):
                results[sum] = results[sum] + 1
            else:
                results[sum] = 1
                
print max((results[x], x) for x in results.keys())

